
// 图表通用属性

module.exports = {
  data: {
    type: Array,
    default () {
      return [
        ['姓名', '张思睿', '李福娥', '王飞虎'],
        ['语文', 43.3, 85.8, 93.7],
        ['数学', 83.1, 73.4, 55.1],
        ['英语', 86.4, 65.2, 82.5],
        ['物理', 84.4, 80, 85]
      ]
    },
    name: '图表数据集',
    filedType: 'api'
  },

  height: {
    type: String,
    default: '160px',
    name: '图表容器高度',
    filedType: 'string'
  },

  width: {
    type: String,
    default: '300px',
    name: '图表容器宽度',
    filedType: 'string'
  },

  bgColor: {
    type: String,
    default: '#fff',
    name: '背景颜色',
    filedType: 'color'
  },

  colors: {
    type: Array,
    default () {
      return [
        '#657df5',
        '#ffb336',
        '#4ac7ff',
        '#2bd3bd',
        '#96e388',
        '#fecd63',
        '#1276ff',
        '#03d6ef',
        '#7114ff',
        '#b62ad1',
        '#f83818',
        '#ff9e13',
        '#ffc513',
        '#5bd917',
        '#17d9b2'
      ]
    },
    name: '调色板',
    nameTip: '图表按此处指定的值循环取色',
    filedType: 'list',
    subType: 'color',
    subDefault: '#2bd3bd',
    max: 20
  },

  // 图表标题
  showTitle: {
    type: Boolean,
    default: false,
    name: '显示标题',
    filedType: 'switch'
  },

  titleText: {
    type: String,
    default: '图表标题',
    name: '图表标题',
    filedType: 'string'
  },

  subtitleText: {
    type: String,
    default: '图表副标题',
    name: '图表副标题',
    filedType: 'string'
  },

  // 图例
  showLegend: {
    type: Boolean,
    default: true,
    name: '显示图列',
    filedType: 'switch'
  },
  legendFontSize: {
    type: String,
    default: '12',
    name: '图例字体',
    filedType: 'string'
  },

  legendColor: {
    type: String,
    default: '#333',
    name: '图例颜色',
    filedType: 'color'
  },

  icon: {
    type: String,
    default: 'roundRect',
    name: '图例数据类型',
    filedType: 'select',
    options: [
      {
        name: '方块',
        value: 'rect'
      },
      {
        name: '圆点',
        value: 'circle'
      },
      {
        name: '圆角方块',
        value: 'roundRect'
      }
    ]
  },

  legendLeft: {
    type: String,
    default: 'center',
    name: '图例左侧距离',
    filedType: 'string'
  },

  legendTop: {
    type: String,
    default: 'auto',
    name: '图例上侧距离',
    filedType: 'string'
  },

  legendRight: {
    type: String,
    default: 'auto',
    name: '图例右侧距离',
    filedType: 'string'
  },

  legendBottom: {
    type: String,
    default: 'auto',
    name: '图例下侧距离',
    filedType: 'string'
  },
  legendHeight: {
    type: String,
    default: '10',
    name: '图例高度',
    filedType: 'string'
  },
  legendWidth: {
    type: String,
    default: '10',
    name: '图例宽度',
    filedType: 'string'
  },

  // 网格
  showGrid: {
    type: Boolean,
    default: false,
    name: '显示网格',
    filedType: 'switch'
  },

  gridLeft: {
    type: String,
    default: 'auto',
    name: 'Grid左侧距离',
    filedType: 'string'
  },

  gridTop: {
    type: String,
    default: '20%',
    name: 'Grid上侧距离',
    filedType: 'string'
  },

  gridRight: {
    type: String,
    default: 'auto',
    name: 'Grid右侧距离',
    filedType: 'string'
  },

  gridBottom: {
    type: String,
    default: 'auto',
    name: 'Grid下侧距离',
    filedType: 'string'
  },

  showAxis: {
    type: Boolean,
    default: true,
    name: '显示坐标轴',
    filedType: 'switch'
  },

  useLiandong: {
    type: Boolean,
    default: true,
    name: '启用点击事件',
    filedType: 'switch'
  },
}
